<?php 

if ($_REQUEST["feedback_commit"])
{
	require 'language_related_variables.php';
	error_reporting(0);
	$language_decoder=array('de'=>"german", 'en'=>"english", 'es'=>"spanish", 'ru'=>"russian");
	$url_part_array= explode(".", $_SERVER['SERVER_NAME']);
	$site_language_short=$url_part_array[0];
	if ($site_language_short == 'lingomoto') {$site_language_short = 'en';}
	$site_language= $language_decoder[$site_language_short];
	if (!$site_language){$site_language="german";$site_language_short="de";}
	$LRV=filter_by_language($site_language);
	require $LRV["link_configuration"];
	$arrFeedback=$_REQUEST["feedback"];
	$strQuery=	"INSERT INTO feedback (name, email,text,answered,processed,answer,url) ". 
				"VALUES('{$arrFeedback['name']}','{$arrFeedback['email']}','{$arrFeedback['text']}',".
				"FALSE,FALSE,'','{$arrFeedback['url']}')";
	mysql_query($strQuery);
	
	print 
	'<script type="text/javascript">
	alert("Thank you! Danke! Gracias!:)");
	</script>
	<meta http-equiv="refresh" content="0; URL='.$arrFeedback['url'].'">';
	
}

?>

<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link type="text/css" href="style.css" rel="stylesheet" />
<div id='feedback_div'>
	<div id="feedback_button" ><img alt="feedback form" src="/bilder/feedback.jpg"></div>
	<div class="feedback_form" id="feedback_form">

		<form action="/feedback.html" class="new_feedback" id="new_feedback" method="post"><div style="margin:0;padding:0;display:inline"><input name="authenticity_token" type="hidden" value="5HzvoenrPLa1rZPFD7QJLdZfb46TmON0jtCHxAUcThU=" /></div>
			<h3><?php print $LRV["title_give_feedback"];?></h3>
			<p><br><?php print $LRV["info_give_feedback"];?></p>
			<dl>
			<input type="hidden" name="feedback[url]" value="<?php print $_SERVER['PHP_SELF'];?>">
			<dt><label for="feedback_name"><?php print $LRV["label_name_feedback"];?>:</label></dt>
			<dd><input id="feedback_name" name="feedback[name]" size="30" type="text" /></dd>
			<dt><label for="feedback_email"><?php print $LRV["label_email_feedback"];?>:</label></dt>
			<dd><input id="feedback_email" name="feedback[email]" size="30" type="text" /></dd>
			<dt><label for="feedback_content"><?php print $LRV["label_your_feedback"];?>: *</label></dt>
			
			<dd><textarea class="required" cols="20" id="feedback_content" name="feedback[text]" rows="5"></textarea></dd>
			</dl>
			<ul class="actions">
				<li class="submit"><input id="feedback_submit" name="feedback_commit" type="submit" value="<?php print $LRV["button_send_feedback"];?>" /></li>
				<li class="toggle_cancel">
					<div id="feedback_button_cancel"><?php print $LRV["button_close_feedback"];?></a>
				</li>
			</ul>
        </form>
	</div>
</div>